package com.penghk.earth.job;

import org.quartz.*;
import org.springframework.stereotype.Component;

@DisallowConcurrentExecution
@Component("factoryJob")
public class FactoryJob implements InterruptableJob {

    private int count= 0;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        String value = (String) context.getMergedJobDataMap().get("name");
//        Integer count = (Integer) context.getMergedJobDataMap().get("count");
        count++;
        System.out.println("第"+count+" 次调用　"+value+" 你想干哈咧");
//        context.getMergedJobDataMap().put("count" , count);
    }


    @Override
    public void interrupt() throws UnableToInterruptJobException {
        System.out.println("being interrupted");
    }
}
